﻿//+:cnd:noEmit
//#if (sample == true || offlineDb == true)
using Boilerplate.Shared.Dtos.Todo;
//#endif
//#if (module == "Admin")
using Boilerplate.Shared.Dtos.Dashboard;
//#endif
//#if (module == "Admin" || module == "Sales")
using Boilerplate.Shared.Dtos.Products;
using Boilerplate.Shared.Dtos.Categories;
//#endif
//#if (notification == true)
using Boilerplate.Shared.Dtos.PushNotification;
//#endif
//#if (signalR == true)
using Boilerplate.Shared.Dtos.Chatbot;
using Boilerplate.Shared.Dtos.SignalR;
//#endif
using Boilerplate.Shared.Dtos.Identity;
using Boilerplate.Shared.Dtos.Statistics;
using Boilerplate.Shared.Dtos.Diagnostic;
//#if (offlineDb == true)
using CommunityToolkit.Datasync.Server.Abstractions.Json;
//#endif

namespace Boilerplate.Shared.Dtos;

/// <summary>
/// https://devblogs.microsoft.com/dotnet/try-the-new-system-text-json-source-generator/
/// </summary>
[JsonSourceGenerationOptions(

  //#if (offlineDb == true)
  Converters = [
    typeof(DateTimeConverter),
    typeof(DateTimeOffsetConverter),
    typeof(TimeOnlyConverter)
  ],
  //#endif


  PropertyNameCaseInsensitive = true,
  PropertyNamingPolicy = JsonKnownNamingPolicy.CamelCase,
  DictionaryKeyPolicy = JsonKnownNamingPolicy.CamelCase,
  UseStringEnumConverter = true,
  WriteIndented = false,
  GenerationMode = JsonSourceGenerationMode.Metadata,
  AllowTrailingCommas = true,
  DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingDefault
)]


[JsonSerializable(typeof(Dictionary<string, JsonElement>))]
[JsonSerializable(typeof(Dictionary<string, string?>))]
[JsonSerializable(typeof(TimeSpan))]
[JsonSerializable(typeof(string[]))]
[JsonSerializable(typeof(Guid[]))]
[JsonSerializable(typeof(GitHubStats))]
[JsonSerializable(typeof(NugetStatsDto))]
[JsonSerializable(typeof(AppProblemDetails))]
//#if (notification == true || signalR == true)
[JsonSerializable(typeof(SendNotificationToRoleDto))]
//#endif
//#if (notification == true)
[JsonSerializable(typeof(PushNotificationSubscriptionDto))]
//#endif
//#if (sample == true || offlineDb == true)
[JsonSerializable(typeof(TodoItemDto))]
[JsonSerializable(typeof(PagedResponse<TodoItemDto>))]
[JsonSerializable(typeof(List<TodoItemDto>))]
//#endif
//#if (module == "Admin" || module == "Sales")
[JsonSerializable(typeof(CategoryDto))]
[JsonSerializable(typeof(List<CategoryDto>))]
[JsonSerializable(typeof(PagedResponse<CategoryDto>))]
[JsonSerializable(typeof(ProductDto))]
[JsonSerializable(typeof(List<ProductDto>))]
[JsonSerializable(typeof(PagedResponse<ProductDto>))]
//#endif
//#if (module == "Admin")
[JsonSerializable(typeof(List<ProductsCountPerCategoryResponseDto>))]
[JsonSerializable(typeof(OverallAnalyticsStatsDataResponseDto))]
[JsonSerializable(typeof(List<ProductPercentagePerCategoryResponseDto>))]
//#endif
[JsonSerializable(typeof(VerifyWebAuthnAndSignInRequestDto))]
[JsonSerializable(typeof(WebAuthnAssertionOptionsRequestDto))]

//#if (signalR == true)
[JsonSerializable(typeof(DiagnosticLogDto[]))]
[JsonSerializable(typeof(StartChatRequest))]
[JsonSerializable(typeof(List<SystemPromptDto>))]
[JsonSerializable(typeof(BackgroundJobProgressDto))]
//#endif
public partial class AppJsonContext : JsonSerializerContext
{
}
